#ifndef SENDFILE_H
#define SENDFILE_H

#include <QObject>


#include <qfile.h>
#include <qfiledialog.h>
#include <qstandardpaths.h>
#include <qserialport.h>
#include <qserialportinfo.h>
#include <qmessagebox.h>
#include <qthread.h>
#include <qdebug.h>
#include <protocol.h>
#include <qsemaphore.h>


class sendfile : public QObject
{
    Q_OBJECT
public:
    explicit sendfile(QObject *parent = nullptr);

    bool get_update_sta();
    void upgrade_frameware();
    bool upgrade_pack(QByteArray data,int pack_num,int current_pack_num,unsigned int version);


public slots:
    void setfilename(QString);
    QString getfilename();



signals:
    void sendmsg(QByteArray);
    void dis_result(QString);
    void err(QString);
    void setProgress(int);
    void setProgressMax(int);


private:
    QString filename;
    QFile file;
    int version;


};

#endif // SENDFILE_H
